Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Feb 1, 2026

Summary

Adds a "new version available" notification that displays after CLI commands complete, notifying users when a newer version is available on GitHub releases.

Key Features

  • Background check: Probabilistic check (~once per day) that doesn't block CLI execution
  • Cached results: Version info stored in SQLite metadata table for instant notifications on subsequent runs
  • Smart suppression: Notifications suppressed for upgrade, --version, -V, and --json flags
  • Opt-out: SENTRY_CLI_NO_UPDATE_CHECK=1 environment variable to disable entirely
  • Observability: Errors reported to Sentry via detached span
  • Node.js support: Polyfill for Bun.semver using the semver package

Example Output

$ sentry issue list
...command output...

Update available: 0.5.0 → 0.6.0  Run "sentry upgrade" to update.

Add a "new version available" notification that displays after CLI commands.
The notification appears when a newer version is detected on GitHub releases.

Key features:
- Probabilistic background check (~once per day) that doesn't block execution
- Cached version info in SQLite metadata table for instant notifications
- Suppressed for upgrade, --version, -V, and --json flags
- Opt-out via SENTRY_CLI_NO_UPDATE_CHECK=1 environment variable
- Errors reported to Sentry via detached span for visibility
- Node.js polyfill for Bun.semver using semver package
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (feedback) Add command to submit CLI feedback by betegon in #150
  • (upgrade) Add self-update command by betegon in #132
  • Add update available notification by BYK in #151

Bug Fixes 🐛

  • (telemetry) Capture command errors to Sentry by betegon in #145
  • Update docs URL in help output by betegon in #149

Documentation 📚

  • (upgrade) Add documentation for upgrade command by betegon in #152
  • Update README and AGENTS.md by betegon in #148

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Codecov Results 📊

✅ Patch coverage is 82.24%. Project has 2027 uncovered lines.
✅ Project coverage is 68.3%. Comparing base (base) to head (head).

Files with missing lines (27)
File Patch % Lines
human.ts 31.87% ⚠️ 682 Missing
resolve-target.ts 20.82% ⚠️ 251 Missing
oauth.ts 25.10% ⚠️ 194 Missing
upgrade.ts 34.25% ⚠️ 167 Missing
api-client.ts 71.60% ⚠️ 146 Missing
resolver.ts 3.23% ⚠️ 120 Missing
errors.ts 5.94% ⚠️ 95 Missing
migration.ts 47.44% ⚠️ 82 Missing
upgrade.ts 38.78% ⚠️ 60 Missing
api.ts 89.80% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
seer.ts 79.87% ⚠️ 30 Missing
preload.ts 39.02% ⚠️ 25 Missing
version-check.ts 76.00% ⚠️ 18 Missing
detector.ts 87.79% ⚠️ 16 Missing
schema.ts 64.10% ⚠️ 14 Missing
auth.ts 94.78% ⚠️ 7 Missing
utils.ts 97.59% ⚠️ 4 Missing
index.ts 95.06% ⚠️ 4 Missing
colors.ts 91.84% ⚠️ 4 Missing
telemetry.ts 97.16% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
sentry-urls.ts 82.35% ⚠️ 3 Missing
alias.ts 98.56% ⚠️ 2 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    68.08%    68.30%    +0.22%
==========================================
  Files           53        55        +2
  Lines         6290      6395      +105
  Branches         0         0         —
==========================================
+ Hits          4282      4368       +86
- Misses        2008      2027       +19
- Partials         0         0         —

Generated by Codecov Action

- Export shouldCheckForUpdate for direct testing
- Add tests for probabilistic check behavior
- Add tests for getUpdateNotification with different DB states
- Add test for opt-out behavior via subprocess
- Simplify semver polyfill to shorthand syntax
- Move --json into SUPPRESSED_ARGS Set
- Bake getVersionCheckInfo() into shouldCheckForUpdate()
- Refactor to async/await instead of .then().catch().finally()
- Add AbortController for clean process exit
- Pass signal to fetchLatestFromGitHub for cancellation support
@BYK BYK marked this pull request as ready for review February 2, 2026 11:34
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Wrap version check DB operations in try/catch to prevent CLI crashes
- Report caught errors to Sentry for visibility
- Remove unused semverSatisfies import and satisfies property from polyfill
@BYK BYK merged commit 9a3ce8b into main Feb 2, 2026
24 checks passed
@BYK BYK deleted the feat/version-update-notification branch February 2, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants